#!/usr/bin/env python
import os, sys
from transaction_class import Transaction

def set_kind ( liwe, id_kind = 0, mode= '', descr = '', name = '',charge = 0, visible = 0, module = '' ):
	"""
	:INPUT:
		- id_kind:		SAFE_NUMBER
		- name:			SAFE_DB_STRING
		- mode:			SAFE_DB_STRING
		- descr:		SAFE_HTML
		- charge:		SAFE_MONEY
		- visible:		SAFE_NUMBER
		- module:		SAFE_STRING
	:PERMS:
		- admin:
	"""
	t = Transaction ( liwe )
	resp = t.set_kind ( id_kind = id_kind, mode = mode, name = name, descr = descr, charge = charge, module = module, visible = visible  )
	return { 'kind' : resp }

def del_kind ( liwe, ids = "" ):
	"""
	:INPUT:
		-ids: SAFE_DB_STRING
	:PERMS:
		- admin:
	"""
	t = Transaction ( liwe )
	resp =  t.del_kind ( ids =  ids ) 

def set_kind_visible ( liwe, ids, visible = 0 ):
	"""
	:INPUT:

		- ids:		SAFE_STRING
		- visible: 	SAFE_NUMBER

	:PERMS:
		- create:		With this permission you can create/modify users
	"""
	t = Transaction ( liwe )
	return { 'kind' : t.set_kind_visible ( uids, visible ) }

def set_kind_visible ( liwe, ids = "" ):
	"""
	:INPUT:
		-ids: SAFE_DB_STRING
	:PERMS:
		- admin:
	"""
	t = Transaction ( liwe )
	resp =  t.set_kind_visible ( ids =  ids ) 

def get_valid_modules ( liwe ):
	t = Transaction ( liwe )
	return { 'mods' :  t.cfg.get ( "mod_include" ) }

   
